package com.smalltao.core.base.entity;

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;

/**
 * @author smallTao.liu
 * @version V1.0
 * @description 系统日志 由aop存入
 * @date 2018/11/14 15:00
 */
@Entity
@Table(schema = "系统日志表")
public class SysLog extends BaseEntity {

    private static final long serialVersionUID = -384228904030316578L;

    /**
     * 主键
     */
    private String uid;

    /**
     * 产生日志的url或class
     */
    private String details;

    /**
     * 产生日志的class.method
     */
    private String method;

    /**
     * 日志类型：url请求/ex异常
     */
    private String logType;

    /**
     * 发起请求的ip地址
     */
    private String reqIp;

    /**
     * 错误码
     */
    private String exCode;

    /**
     * 错误信息
     */
    private String exMsg;

    /**
     * 错误明细
     */
    private String exDetail;

    /**
     * 请求参数
     */
    private String params;

    /**
     * 操作类型
     */
    private String operationType;

    /**
     * 具体操作
     */
    private String operationName;

    @Id
    @GenericGenerator(name = "generator", strategy = "uuid")
    @GeneratedValue(generator = "generator")
    @Column(length = 32)
    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    @Column(length = 1000)
    public String getDetails() {
        return details;
    }

    public void setDetails(String details) {
        this.details = details;
    }

    @Column(length = 1000)
    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public String getLogType() {
        return logType;
    }

    public void setLogType(String logType) {
        this.logType = logType;
    }

    public String getReqIp() {
        return reqIp;
    }

    public void setReqIp(String reqIp) {
        this.reqIp = reqIp;
    }

    public String getExCode() {
        return exCode;
    }

    public void setExCode(String exCode) {
        this.exCode = exCode;
    }

    @Column(columnDefinition = "TEXT")
    public String getExMsg() {
        return exMsg;
    }

    public void setExMsg(String exMsg) {
        this.exMsg = exMsg;
    }

    @Column(columnDefinition = "TEXT")
    public String getExDetail() {
        return exDetail;
    }

    public void setExDetail(String exDetail) {
        this.exDetail = exDetail;
    }

    @Column(length = 5000)
    public String getParams() {
        return params;
    }

    public void setParams(String params) {
        this.params = params;
    }

    public String getOperationType() {
        return operationType;
    }

    public void setOperationType(String operationType) {
        this.operationType = operationType;
    }

    public String getOperationName() {
        return operationName;
    }

    public void setOperationName(String operationName) {
        this.operationName = operationName;
    }
}
